package com.feihao.zhou.ThreadSaveDemo3;

import java.util.concurrent.locks.Lock;

//线程执行的锁对象：
public class Desk {
    private int count;
    private boolean flag;

    public Desk(int count, boolean flag) {
        this.count = count;
        this.flag = flag;
    }

    public Desk() {
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    @Override
    public String toString() {
        return "Desk{" +
                "count=" + count +
                ", flag=" + flag +
                '}';
    }
}



















































   /* private boolean flag;
    private int count;
    private Lock lock;

    public Desk(boolean flag, int count) {
        this.flag = flag;
        this.count = count;

    }

    public Desk() {
        this.flag = false;
        this.count =10;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public Lock getLock() {
        return lock;
    }

    public void setLock(Lock lock) {
        this.lock = lock;
    }

    @Override
    public String toString() {
        return "Desk{" +
                "flag=" + flag +
                ", count=" + count +
                '}';
    }
}*/
